import request from '@/plugin/axios'

export function page (queryParam) {
  return request({
    url: '/goods/product-attribute-category/page',
    method: 'get',
    params: queryParam
  })
}

export function saveAttrCate (obj) {
  return request({
    url: '/goods/product-attribute-category',
    method: 'post',
    data: obj
  })
}

export function deleteAttrCate (id) {
  return request({
    url: '/goods/product-attribute-category/' + id,
    method: 'delete'
  })
}

export function batchDeleteAttrCate (ids) {
  return request({
    url: '/goods/product-attribute-category/batch',
    method: 'delete',
    params: {
      ids: ids
    }
  })
}

export function pageProductAttr (queryParam) {
  return request({
    url: '/goods/product-attribute/page',
    method: 'get',
    params: queryParam
  })
}

export function listAttrCateOptions () {
  return request({
    url: '/goods/product-attribute-category/options',
    method: 'get'
  })
}

export function updateAttrCate (obj) {
  return request({
    url: '/goods/product-attribute-category',
    method: 'put',
    data: obj
  })
}

export function saveProductAttr (obj) {
  return request({
    url: '/goods/product-attribute',
    method: 'post',
    data: obj
  })
}

export function deleteProductAttr (id) {
  return request({
    url: '/goods/product-attribute/' + id,
    method: 'delete'
  })
}
